package br.com.rapidrest.util;

import java.util.Locale;

import javax.servlet.http.HttpServletRequest;

public class LocaleManager {

	public static final String LOCALE_SESSION_KEY = "rapidrest.locale.key";

	public void set(HttpServletRequest req, Locale locale) {
		req.getSession().setAttribute(LOCALE_SESSION_KEY, locale); 
	}

	public Locale get(HttpServletRequest req) {
		return (Locale) req.getSession().getAttribute(LOCALE_SESSION_KEY);
	}

}
